﻿using ConfExpert.Forms.Base;
using DevExpress.Utils;
using DevTeam;

using System;
using System.Drawing;

namespace ConfExpert.Forms.Depo.Texcomm
{
    public partial class Tuketim : XForm
    {
        string idx;
        public Tuketim(string _idx)
        {
            InitializeComponent();
            idx = _idx;
        }


        private void Tuketim_Load(object sender, EventArgs e)
        {

            gridView1.Init("GetTexcommTuketim", idx);
            gridView1.AddDetailGrid(gridView2, "ProductId");

            //bs1 = new BindingSource(ds, "xKaufTuketim");
            //bs2 = new BindingSource(bs1, "FK_xKaufTuketimLines_xKaufTuketim_ProductId");

            //InitGridView(gridView1, bs1);
            //InitGridView(gridView2, bs2);

            //GetDetails("xKaufTuketim;xKaufTuketimLines", "GetKaufTuketim", idx);

            gridView1.AddSummary("QtyDepo", "QtyNeeded");
            gridView2.AddSummary("Adet", "QtyNeeded");
            gridView1.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(gridView1_RowCellStyle);
            splitContainerControl1.AutoSize();

            gridView1.UpdateTotalSummary();
            //gridView1.BestFitColumns();
            //gridView2.BestFitColumns();
        }

        void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            if (e.Column.FieldName == "Durum")
                e.Appearance.Font = new Font(AppearanceObject.DefaultFont, FontStyle.Bold);
        }

    }
}